home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / Includes / CIBasic.h next >
Encoding:
C/C++ Source or Header  |  1996-11-18  |  4.2 KB  |  131 lines  |  [TEXT/CWIE]

  1. /**[f******************************************************************
  2.  *    CIBasic.h -- CIBasic Interface definition
  3.  *
  4.  *    Copyright (c) 1996 Adobe Systems, Inc. All Rights Reserved
  5.  *
  6.  *    
  7.  * ABSTRACT:  
  8.  *
  9.  * USAGE: 
  10.  *
  11.  * ROUTINES DEFINED:
  12.  *
  13.  * $Revision:   1.9  $
  14.  *
  15.  *
  16.  *
  17.  **f]******************************************************************/ 
  18.  
  19. #ifndef __CIBASIC_H
  20. #define __CIBASIC_H
  21.  
  22. #include "PMEvent.h"
  23.  
  24. // DataType used by GetParm  
  25. typedef enum
  26. {
  27.     PMXTShort = 0,
  28.     PMXTHandle,
  29.     PMXTLong,
  30.     PMXTByte,
  31.     PMXTText,
  32.     PMXTBool
  33. } eDataType;
  34.  
  35. // DataType for Co-ordinate system utility routines
  36. #ifndef    DC
  37.     typedef short DC;            // screen device coordinates
  38.     typedef    short WC;            // World Coordinates
  39.     typedef struct __WCPOINT {
  40.         WC x;
  41.         WC y;
  42.     } WCPOINT, DCPOINT, *LPWCPOINT, *LPDCPOINT;
  43.     typedef struct __LONGPOINT {
  44.         long x;
  45.         long y;
  46.     } LONGPOINT, *LPLONGPOINT;
  47. #endif
  48.  
  49. class CIBasic : public CIInterface {
  50. public:
  51.     //    Memory functions. Plug-ins are strongly recomended to use 
  52.     //    these function to manage their memory.
  53.     virtual void *PMMemAlloc(unsigned long) = 0;
  54.     virtual void PMMemFree(void *) = 0;
  55.     virtual void *PMMemRealloc(void *, unsigned long) = 0;
  56.  
  57.     //    Windows only basic functions
  58. #ifdef WINDOWS
  59.     virtual HINSTANCE    GetPMInst() = 0;
  60.     //    Retrieve the PageMaker external resource instance.
  61.     virtual HINSTANCE    GetPMResInst() = 0;
  62. #endif
  63.  
  64.     // Set library property (i.e. kStayInMem) return old property
  65.     // If you want to turn off kStayInMem, you should do the following
  66.     // pBasic->SetPlugInLibProperty(pBasic->GetPlugInLibProperty() & ~kStayInMem))
  67.     virtual PMXErr SetPlugInLibProperty(unsigned long theProperty)=0;
  68.     virtual unsigned long GetPlugInLibProperty()=0;
  69.  
  70.     //    Retrieve the version of PageMaker plug-in interface
  71.     virtual unsigned short    PMInterfaceVersion() = 0;
  72.  
  73.     //    Registration of PMEvent
  74.     virtual PMXErr    RegisterPMEvent(PMEventID eventID) = 0;
  75.     virtual PMXErr    UnregisterPMEvent(PMEventID eventID) = 0;
  76.  
  77.     // Plugin Command Param Block - extract data from PMEVT_PLUGIN_COMMAND ParamData 
  78.     virtual    char     *LockData(void * ParamData, int ParamNumber=0) = 0;
  79.     virtual    PMXErr    LockData(void * ParamData, void * pBuffer, int BuffSize) = 0;
  80.     virtual    void    Unlock(void * ParamData, int ParamNumber=0) = 0;
  81.     virtual    PMXErr    GetParm(void * ParamData, int ParamNumber, int DataType, void * pBuffer) = 0;
  82.  
  83.     // Co-ordinate system utility routines
  84.     virtual    PMXErr    SetDCOrg(LONGPOINT *pNewPubDC, LONGPOINT *pOldPubDC) = 0;
  85.     
  86.     // position of the center of pasteboard offset from the upper-left-hand corner of
  87.     // the pub window and the screen (in pixel)
  88.     virtual PMXErr    GetDCOrg(LONGPOINT *pPubDC, LONGPOINT *pScreenDC) = 0;
  89.  
  90.     // get ruler zero point relative to the center of the pasteboard (in twips)
  91.     virtual PMXErr    GetRulerOrg(LONGPOINT *pRulerOrg) = 0;
  92.  
  93.     // Coordinate conversion procedures includes offset from Pub origin
  94.     virtual    DC        WCtoXDC(WC xwc) = 0;
  95.     virtual    DC        WCtoYDC(WC ywc) = 0;
  96.     virtual    WC        XDCtoWC(DC xdc) = 0;
  97.     virtual    WC        YDCtoWC(DC ydc) = 0;
  98.     // Long versions of coordinate conversion procedures.
  99.     virtual    DC        LWCtoXDC(long lwc) = 0;
  100.     virtual    DC        LWCtoYDC(long lwc) = 0;
  101.     virtual    long    XDCtoLWC(DC xdc) = 0;
  102.     virtual    long    YDCtoLWC(DC ydc) = 0;
  103.  
  104.     // Unit conversion procedures no offset from origin 
  105.     virtual    DC        WUtoXDU(WC wu) = 0;
  106.     virtual    DC        WUtoYDU(WC wu) = 0;
  107.     virtual    WC        XDUtoWU(DC xdu) = 0;
  108.     virtual    WC        YDUtoWU(DC ydu) = 0;
  109.     virtual    long    LXDUtoLWU(long xdu) = 0;
  110.     virtual    long    LYDUtoLWU(long ydu) = 0;
  111.  
  112.     // point conversion procedures
  113.     virtual    void    WCtoDC(LPWCPOINT pwcpoint, LPDCPOINT pdcpoint) = 0;
  114.     virtual    void    DCtoWC(LPDCPOINT pdcpoint, LPWCPOINT  pwcpoint) = 0;
  115.     virtual    void    WUtoDU(LPWCPOINT pwcpoint, LPDCPOINT  pdcpoint) = 0;
  116.     virtual    DC        LWUtoXDU(long wu) = 0;
  117.     virtual    DC        LWUtoYDU(long wu) = 0;
  118.     virtual    long    LWUtoLXDU(long wu) = 0;
  119.     virtual    long    LWUtoLYDU(long wu) = 0;
  120. };
  121.  
  122. class CIPMInfo : public CIInterface {
  123. public:
  124.     virtual char *GetRegisterUserName()=0;
  125.     virtual char *GetRegisterCompanyName()=0;
  126.     virtual char *GetRegisterSerialNumber()=0;
  127.     virtual void GetVersionNumber(unsigned short *pMajorVerionNumber, unsigned short *pMinorVerionNumber)=0;
  128. //    virtual PMLANGUAGE GetPMLanguageVersion()=0;    
  129. };
  130. #endif
  131.